const express = require('express')
const app = express()

//中间件
let webpack = require('webpack')
let middle = require('webpack-dev-middleware')
let compiler = webpack(require('./webpack.config.js'))
app.use(middle(compiler))

app.get('/user', (req, res) => {
  res.json({
    name: 'jack'
  })
})

app.listen(3000, () => {
  console.log(`服务启动, 监听3000端口`)
})
